You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ci(security): migrate Firstrade GCP and GCS vars to secrets - #557
Updated 9 workflow files (inspect-account-history-schema.yml, publish-archived-account-history.yml, execution-report-heartbeat.yml, sync-cloud-run-env.yml, runtime-target-lifecycle.yml, ft-session-renew-verify.yml, ft-session-check-marker-reset.yml, publish-runtime-daily-once.yml, and ft-afs-align-broker-account.yml) to read ACCOUNT_HISTORY_GCP_PROJECT_ID, ACCOUNT_HISTORY_GCP_SERVICE_ACCOUNT, ACCOUNT_HISTORY_GCP_WIF_PROVIDER, DIGEST_CANDIDATES_OVERRIDE_GCS_URI, EXECUTION_REPORT_GCS_URI, and FIRSTRADE_GCS_STATE_BUCKET from secrets.* instead of public vars.*.
How verified
Staged all 6 keys in repository secrets.*.
Verified zero vars. references remain for the 6 migrated keys across .github/workflows/.
Ran pytest -q tests/test_runtime_monitor_workflows.py and workflow config checks locally.
Why
Completes Security Batch 4D migration in QuantStrategyLab/FirstradePlatform before deleting those 6 public repository variables post-merge.
Risk
Low. Repository secrets were staged before switching workflow bindings; public variable deletion happens strictly post-merge.
The PR migrates six configuration keys from public vars.* to secrets.* across nine workflows. The mechanical substitution is consistent, but it introduces a real regression: secrets.* cannot be used in if: expressions or in some contexts, and more importantly the report-prefix/RUNTIME_HEARTBEAT_GCS_URIS fallbacks now depend on a secret that may be unset, silently degrading heartbeat/guard behavior. Also, secrets are masked in logs but the values here (project id, bucket, WIF provider, service account) are not actually secrets and moving them to secrets reduces auditability; more critically, secrets.* are unavailable to fork PRs and to pull_request events, which can break workflows that previously worked. No hardcoded credentials, no weakened auth gates, and actions remain SHA-pinned, so the security checklist items 1, 2, 4, 5 are satisfied. The main concerns are correctness/robustness of the fallback chains and missing test coverage for the new bindings.
[MEDIUM].github/workflows/execution-report-heartbeat.yml: report-prefix: ${{ vars.RUNTIME_HEARTBEAT_GCS_URIS || secrets.EXECUTION_REPORT_GCS_URI }} and the RUNTIME_HEARTBEAT_GCS_URIS fallback in runtime-target-lifecycle.yml now depend on a secret. If the secret is unset (e.g. fork PR, or before staging completes), the expression evaluates to empty string and the heartbeat/guard step silently runs with no prefix instead of failing closed. Previously the public var made this observable. Add an explicit guard step that fails when the resolved value is empty.
[MEDIUM].github/workflows/execution-report-heartbeat.yml: EXECUTION_REPORT_GCS_URI was changed from vars.EXECUTION_REPORT_GCS_URI || secrets.EXECUTION_REPORT_GCS_URI to secrets.EXECUTION_REPORT_GCS_URI only. This removes the fallback that previously allowed the workflow to run when only the public var was set. If the staged secret is missing or misnamed, downstream steps receive an empty URI with no error. Add a preflight validation step asserting the required env vars are non-empty.
[MEDIUM].github/workflows/inspect-account-history-schema.yml: workload_identity_provider and service_account are now read from secrets.*. These are not secrets (they are public identifiers) and moving them to secrets means they are unavailable on pull_request from forks and are masked in logs, making WIF misconfiguration harder to diagnose. Confirm the workflow is not triggered by pull_request; if it is, this change breaks it. Prefer keeping non-sensitive identifiers in vars.* and only moving genuinely sensitive values.
[LOW].github/workflows/publish-archived-account-history.yml: project_id: ${{ secrets.ACCOUNT_HISTORY_GCP_PROJECT_ID }} passed to setup-gcloud — if the secret is unset the action receives an empty string and may fall back to ambient project, silently targeting the wrong project. Add an explicit if: env.GCP_PROJECT_ID == '' fail step or assert non-empty before the auth step.
[LOW].github/workflows/sync-cloud-run-env.yml: FIRSTRADE_GCS_STATE_BUCKET and EXECUTION_REPORT_GCS_URI are now secrets but are consumed by a sync step that writes Cloud Run env. If the secret is empty the sync will push an empty bucket/URI into the deployed service, which is a silent misconfiguration rather than a fail-closed error. Validate non-empty before the sync step.
[LOW]tests/test_runtime_monitor_workflows.py: PR claims pytest -q tests/test_runtime_monitor_workflows.py was run, but no test asserts that the six keys are now sourced from secrets.* and that no vars.* references remain. Add a regression test that greps the workflow files for the migrated keys and asserts the secrets. binding, so a future revert is caught.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
agent-approvedAn agent cleared this high-risk change on the current head; not an owner confirmation
1 participant
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
AI assistance
Generated with assistance from Antigravity agent.
What changed
inspect-account-history-schema.yml,publish-archived-account-history.yml,execution-report-heartbeat.yml,sync-cloud-run-env.yml,runtime-target-lifecycle.yml,ft-session-renew-verify.yml,ft-session-check-marker-reset.yml,publish-runtime-daily-once.yml, andft-afs-align-broker-account.yml) to readACCOUNT_HISTORY_GCP_PROJECT_ID,ACCOUNT_HISTORY_GCP_SERVICE_ACCOUNT,ACCOUNT_HISTORY_GCP_WIF_PROVIDER,DIGEST_CANDIDATES_OVERRIDE_GCS_URI,EXECUTION_REPORT_GCS_URI, andFIRSTRADE_GCS_STATE_BUCKETfromsecrets.*instead of publicvars.*.How verified
secrets.*.vars.references remain for the 6 migrated keys across.github/workflows/.pytest -q tests/test_runtime_monitor_workflows.pyand workflow config checks locally.Why
Completes Security Batch 4D migration in
QuantStrategyLab/FirstradePlatformbefore deleting those 6 public repository variables post-merge.Risk
Low. Repository secrets were staged before switching workflow bindings; public variable deletion happens strictly post-merge.